#include"MyThread.h"
#include <stdio.h>
#ifdef _WIN32
#include <Windows.h>
#else
#include <unistd.h>
#endif

MyThread::MyThread()
{
	isStop=false;
}

MyThread::~MyThread()
{
}

void MyThread::setStop(bool bValue)
{
	isStop=bValue;
}


//do sth you want to handle in thread
void MyThread::run()
{

#ifdef _WIN32
	pthread_detach(getTid()); //windows's bug? cant get corret status
#endif
	while(!isStop)
	{
#ifdef _WIN32
		Sleep(3000);
#else
		sleep(3);
#endif
		printf("in thread %lu!\n",getTid());
	}
}
